package com.aishua.fire.jpa.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import com.aishua.fire.common.anno.EntityDesc;

import lombok.Data;

@EntityDesc(desc="账户表")
@Entity
@Data
public class Account  implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	// 没有默认构造会报错
    public Account(){
    }
    
    public Account(String userName, String userPassword, String aliasName, String phone,
    		Date createDate, String errorCount, String emailAddr) {
		super();
		this.userName = userName;
		this.userPassword = userPassword;
		this.aliasName = aliasName;
		this.phone = phone;
		this.createDate = createDate;
		this.errorCount = errorCount;
		this.emailAddr = emailAddr;
	}

	


	public Account(Long loginId, String userName, String userPassword, String aliasName, String emailAddr,
			String phone, Date createDate, Date lastLoginTime, String errorCount,
			String accountStatus, String status) {
		super();
		this.loginId = loginId;
		this.userName = userName;
		this.userPassword = userPassword;
		this.aliasName = aliasName;
		this.emailAddr = emailAddr;
		this.phone = phone;
		this.createDate = createDate;
		this.lastLoginTime = lastLoginTime;
		this.errorCount = errorCount;
		this.accountStatus = accountStatus;
		this.status = status;
	}




	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "loginId",columnDefinition="bigint COMMENT '主键，自动生成'")
    private Long loginId;
    
    @Column(nullable = false,columnDefinition="varchar(32) COMMENT '用户名'")
    private String userName;
    
    @Column(nullable = false,columnDefinition="varchar(128) COMMENT '用户密码md5加密'")
    private String userPassword;
    
    @Column(nullable = true,columnDefinition="varchar(64) COMMENT '用户别名'")
    private String aliasName;
    
    @Column(nullable = false,columnDefinition="varchar(64) COMMENT '邮箱地址'")
    private String emailAddr;
    
    @Column(nullable = false,columnDefinition="varchar(12) COMMENT '联系电话'")
    private String phone;
    
    @Column(nullable = false,columnDefinition="DATETIME COMMENT '记录添加时间'")
    private Date createDate;
    
    @Column(nullable = true,columnDefinition="DATETIME COMMENT '最后登录时间'")
    private Date lastLoginTime;
    
    @Column(nullable = false,columnDefinition="varchar(6) COMMENT '登录错误连续次数'")
    private String errorCount;
    
    @Column(nullable = false,columnDefinition="varchar(6) COMMENT '账户状态'")
    private String accountStatus;
    
    @Column(nullable = false,columnDefinition="varchar(6) COMMENT '软删除'")
    private String status;
    
}
